/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PanelAlumno.java
 *
 * Created on 09-nov-2011, 16:26:49
 */
package Principal;

import FormulariosMensajes.*;
import PanelesAlumno.PanelAvisosGenerales;
import PanelesAlumno.PanelAyudantia;
import PanelesAlumno.PanelHorario;
import PanelesAlumno.PanelOfertaLaboral;
import PanelesAlumno.PanelPlanificacion;
import PanelesAlumno.PanelSuspensionActividades;
import java.util.ArrayList;
import java.util.HashMap;

/**
 *
 * @author VReyes
 */
public class PestanaAlumno extends javax.swing.JPanel {

    /** Creates new form PanelAlumno */
    private PanelAvisosGenerales avisosGenerales;
    private PanelAyudantia ayudantia;
    private PanelHorario horario;
    private PanelOfertaLaboral ofertaLaboral;
    private PanelPlanificacion planificacion;
    private PanelSuspensionActividades suspensionActividades;
    private HashMap<String,ArrayList> informacion;
    
    public PestanaAlumno() {
        initComponents();
        this.avisosGenerales= new PanelAvisosGenerales();
        this.ayudantia= new PanelAyudantia();
        this.horario= new PanelHorario();
        this.ofertaLaboral = new PanelOfertaLaboral();
        this.planificacion = new PanelPlanificacion();
        this.suspensionActividades = new PanelSuspensionActividades();
        this.informacion= new HashMap<String,ArrayList>();
    }

      /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jSplitPane1 = new javax.swing.JSplitPane();
        jToolBar1 = new javax.swing.JToolBar();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setMinimumSize(new java.awt.Dimension(680, 390));
        setLayout(new java.awt.BorderLayout());

        jToolBar1.setFloatable(false);
        jToolBar1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jToolBar1.setRollover(true);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/22x22/1320861701_preferences-calendar-and-tasks.png"))); // NOI18N
        jButton1.setText("  Cambios de horario");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton1);

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/22x22/suspensionActividades.png"))); // NOI18N
        jButton2.setText("   Suspender clases");
        jButton2.setFocusable(false);
        jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton2);

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/22x22/ayudantia.png"))); // NOI18N
        jButton3.setText("  Solicitar Ayudantías");
        jButton3.setFocusable(false);
        jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton3);

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/22x22/oferta de trabajo.png"))); // NOI18N
        jButton4.setText("    Ofertas laborales");
        jButton4.setFocusable(false);
        jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton4);

        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/22x22/1320861714_x-office-spreadsheet.png"))); // NOI18N
        jButton5.setText("Archivos Planificacion");
        jButton5.setFocusable(false);
        jButton5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton5);

        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/22x22/1320861724_mail-message-new.png"))); // NOI18N
        jButton6.setText("    Avisos Generales");
        jButton6.setFocusable(false);
        jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton6);

        jSplitPane1.setLeftComponent(jToolBar1);

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/OtrasImagenes/logoMagenta.png"))); // NOI18N
        jSplitPane1.setRightComponent(jLabel1);

        add(jSplitPane1, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        // TODO add your handling code here:
        this.jSplitPane1.setRightComponent(avisosGenerales);
        this.avisosGenerales.getCard().show(avisosGenerales.getjPanel3(), "panelTabla");
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        this.jSplitPane1.setRightComponent(horario);
        this.horario.getCard().show(horario.getjPanel3(), "panelTabla");
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        this.jSplitPane1.setRightComponent(suspensionActividades);
        this.suspensionActividades.getCard().show(suspensionActividades.getjPanel3(), "panelTabla");
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        this.jSplitPane1.setRightComponent(ayudantia);
        this.ayudantia.getCard().show(ayudantia.getjPanel3(), "panelTabla");
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        this.jSplitPane1.setRightComponent(ofertaLaboral);
        this.ofertaLaboral.getCard().show(ofertaLaboral.getjPanel3(), "panelTabla");
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        // TODO add your handling code here:
        //this.jSplitPane1.setRightComponent(planificacion);
        this.jSplitPane1.setRightComponent(planificacion);
        this.planificacion.getCard().show(planificacion.getjPanel3(), "panelTabla");
    
    }//GEN-LAST:event_jButton5ActionPerformed

    public HashMap<String,ArrayList> guardarInfo(){
        
        this.informacion.put("avisosGenerales", avisosGenerales.getArrayDeInformacion());
        this.informacion.put("ayudantia", ayudantia.getArrayDeInformacion());
        this.informacion.put("horario", horario.getArrayDeInformacion());
        this.informacion.put("ofertaLaboral", ofertaLaboral.getArrayDeInformacion());
        this.informacion.put("planificacion", planificacion.getArrayDeInformacion());
        this.informacion.put("suspensionActividades", suspensionActividades.getArrayDeInformacion());
        
        return this.informacion;
        
    }
    
    public void obtenerInfo(HashMap<String,ArrayList> hash){
        informacion=hash;
        avisosGenerales.setArrayDeInformacion((ArrayList<FormularioAvisosGenerales>)informacion.get("avisosGenerales"));
        ayudantia.setArrayDeInformacion((ArrayList<FormularioAyudantias>)informacion.get("ayudantia"));
        horario.setArrayDeInformacion((ArrayList<FormularioHorario>)informacion.get("horario"));
        //ofertaLaboral.setArrayDeInformacion((ArrayList<FormularioOfertaLaboral>)informacion.get("ofertaLaboral"));
        planificacion.setArrayDeInformacion((ArrayList<FormularioPlanificación>)informacion.get("planificacion"));
        suspensionActividades.setArrayDeInformacion((ArrayList<FormularioSuspenderClases>)informacion.get("suspensionActividades"));
        
        
    }
    
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JToolBar jToolBar1;
    // End of variables declaration//GEN-END:variables
}
